import { ColumnProps } from "@/components/Table/type";
export const columns: ColumnProps[] = [
  { type: "index", label: "#", width: 50 },
  { prop: "userName", label: "用户名称", search: { el: "input" } },
  { prop: "ip", label: "主机ip", search: { el: "input" } },
  { prop: "loginLocation", label: "登录地点" },
  { prop: "os", label: "操作系统" },
  { prop: "browser", label: "浏览器" },
  {
    prop: "loginTime",
    label: "登录时间",
    render: ({ row }) => {
      const date = new Date(row["loginTime"]);
      return (
        date.getFullYear() +
        "-" +
        (date.getMonth() + 1) +
        "-" +
        date.getDate() +
        " " +
        date.getHours() +
        ":" +
        date.getMinutes() +
        ":" +
        date.getSeconds()
      );
    }
  },
  { prop: "action", label: "操作", width: 150, fixed: "right" }
];
